//双指针
class Solution {
public:
    int maxArea(vector<int>& height) {
        int max=0;
        int left=0;
        int right=height.size()-1;
        while(left<right)
        {
            int v=min(height[left],height[right])*(right-left);
            if(v>max)
            max=v;
            if(height[left]<height[right])
            left++;
            else
            right--;
        }
        return max;
    }
};

